/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package PageHandler;

import EBInterface.AirlineSystemRemote;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 *
 * @author mrxyz
 * Handles all the comunication between the JSPX and the AirlineSystemBean
 * concerning the book trip
 */
public class BookTripResultHandler {

    AirlineSystemRemote ASB = lookupAirlineSystemBean();
    
    public String getReceipt(){
        return ASB.getReceipt();
    }

    private AirlineSystemRemote lookupAirlineSystemBean(){
        try {
            Context c = new InitialContext();
            return (AirlineSystemRemote) c.lookup("java:comp/env/AirlineSystemBean");
        } catch (NamingException ne) {
            java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }

}
